package com.yuyue.springFramework.note10.entity;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ResourceBundleMessageSource;

/**
 * 配置类，注册国际化Bean
 */
@Configuration
public class MyConfig {
    //注意必须是MessageSource类型的，bean名称必须为messageSource
    @Bean
    public ResourceBundleMessageSource messageSource(){
        ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
        messageSource.setBasenames("i18n/message");

        return messageSource;
    }
}
